home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
54455
/
54455.xpi
/
chrome
/
content
/
passfinder.js
< prev
next >
Wrap
Text File
|
2009-12-31
|
3KB
|
74 lines
var passfinder = {};
passfinder.passfinder = function() {
var showMe = document.getElementById("shower").style;
var hideMe = document.getElementById("hider").style;
var currenttabIndex = gBrowser.tabContainer.getIndexOfItem(gBrowser.selectedTab);
var currentBrowser = gBrowser.getBrowserAtIndex(currenttabIndex);
var inputElementList = currentBrowser.contentDocument.getElementsByTagName("input");
var inputElementsLength = inputElementList.length;
// Loop through all the input tags
for(var j = 0; j < inputElementsLength; j++) {
inputElement = inputElementList[j];
// If the element is password
if(inputElement.hasAttribute("type") && inputElement.getAttribute("type").toLowerCase() == "password") {
var temp = inputElement.value;
var tempC = inputElement.offsetwidth;
inputElement.type = "text";
inputElement.value = temp;
inputElement.setAttribute("tc", 1);
if(navigator.preference("extensions.passfinder.bold")){
inputElement.style.fontWeight = "900";
}
if(navigator.preference("extensions.passfinder.ital")){
inputElement.style.fontStyle = "italic";
inputElement.offsetwidth= tempC;
}
if(navigator.preference("extensions.passfinder.cuscol")){
inputElement.style.color = navigator.preference("extensions.passfinder.fgc");
inputElement.style.background = navigator.preference("extensions.passfinder.bgc");
}
}
}
showMe.display = "none";
hideMe.display = "";
navigator.preference("extensions.passfinder.enabled", true);
return;
}
passfinder.hidepassword = function() {
var showMe = document.getElementById("shower").style;
var hideMe = document.getElementById("hider").style;
var currenttabIndex = gBrowser.tabContainer.getIndexOfItem(gBrowser.selectedTab);
var currentBrowser = gBrowser.getBrowserAtIndex(currenttabIndex);
var inputElementList = currentBrowser.contentDocument.getElementsByTagName("input");
var inputElementsLength = inputElementList.length;
// Loop through all the input tags
for(var j = 0; j < inputElementsLength; j++) {
inputElement = inputElementList[j];
// If the element is password
if(inputElement.hasAttribute("tc") && inputElement.getAttribute("tc") == 1) {
var temp = inputElement.value;
//var tempC = inputElement.style;
inputElement.type = "password";
inputElement.value = temp;
//tempC = inputElement.style;
inputElement.removeAttribute("tc");
inputElement.style.color = "#000000";
inputElement.style.background = "#FFFFFF";
inputElement.style.fontWeight = "500";
inputElement.style.fontStyle = "normal";
}
}
showMe.display = "";
hideMe.display = "none";
navigator.preference("extensions.passfinder.enabled", false);
return;
}